<html>
    <head></head>
    <body>
<form method="post" action="<?php echo REGISTRED_ACTION;?>" onsubmit="return checkForm(this);">
    <input type="hidden" name="csrf_token" value="<?php echo $data['page']['csrf_token'];?>'"/>
        <fieldset id="registry">
                <label for="user_email"><?php echo ENTER_YOUR_EMAIL;?></label>
               	<input name="user_email" id="user_email" type="email" required placeholder="email@example.com">
        </fieldset>
        <fieldset>
        		<label for="user_name"><?php echo ENTER_YOUR_USERNAME;?></label>
        		<input name="user_name" id="user_name" type="text" required>
        </fieldset>
        <fieldset>
        		<label for="user_password"><?php echo ENTER_YOUR_PASSWORD;?></label>
        		<input name="user_password" id="user_password" type="password" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{6,}"><?php echo PASSWORD_MESSAGE; ?>
        </fieldset>
        <fieldset>
        		<label for="user_password_validation"><?php echo RETYPE_YOUR_NEW_PASSWORD;?></label>
        		<input name="user_password_validation" id="user_password_validation" type="password" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{6,}">
        </fieldset>
        <input type="submit" value="<?php echo SUBMIT_REGISTRY;?>" />
</form>
        <script type="text/javascript"> 
            function checkPassword(str) { 
                var re = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{6,}$/; return re.test(str); 
            } 
            function checkForm(form) {
                if(form.user_name.value == "") {
                    alert("<?php echo BLANK_USERNAME;?>"); 
                    form.user_name.focus(); return false; } re = /^\w+$/; 
                if(!re.test(form.user_name.value)) { 
                    alert("<?php echo USERNAME_ERROR;?>"); 
                    form.user_name.focus(); 
                    return false; 
                } 
                if(form.user_password.value != "" && form.user_password.value == form.user_password_validation.value) { 
                    if(!checkPassword(form.user_password.value)) { 
                        alert("<?php echo PASSWORD_NOT_VALID; ?>"); 
                        form.user_password.focus(); 
                        return false;  
                    } 
                } 
                else { 
                    alert("<?php echo BAD_PASSWORD;?>");
                    form.user_password.focus();
                    return false; 
                } 
                return true; 
            }
                     </script>

    </body>
</html>